<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script type="text/javascript" src="./ajax1.js"></script>
    <script type="text/javascript" src="./jquery.js"></script>
    <script type="text/javascript">
        window.onload = function(){
            var btn = document.getElementById('btn');
            btn.onclick = function(){
                $.ajax({
                    type : 'get',
                    url : 'http://tom.com/data.php',
                    // dataType : 'jsonp',
                    success:function(data){
                        console.log(data);
                    },
                    error:function(){
                        console.log('failure');
                    }
                });
            }
        }
    </script>
</head>
<body>
    <input type="button" value="点击" id="btn">
</body>
</html>